#pragma once
#include "UILogger.h"
#include "log4cxx/level.h"

class UILog4CXXLogger :	public UILogger
{
public:
	virtual void initLogger(std::string configFile);
	virtual void disable();
	virtual void fatal(UIModuleType moduleType, std::string srcObjClassName, std::string message);
	virtual void warn(UIModuleType moduleType, std::string srcObjClassName, std::string message);
	virtual void inf(UIModuleType moduleType, std::string srcObjClassName, std::string message);
	virtual void err(UIModuleType moduleType, std::string srcObjClassName, std::string message);
	virtual void debug(UIModuleType moduleType, std::string srcObjClassName, std::string message);

protected:
	UILog4CXXLogger(void);
	virtual ~UILog4CXXLogger(void);

	/**
	 * This little helper method imitates the org.apache.log4j.Logger.log 
	 * functionality and results at the end of a call to callAppenders. Before 
	 * this we get the LocationInfo, which would be normally generated deep 
	 * inside the log4j stuff and doesn't know anything about our logging 
	 * framework.
	 * @param loggerName The name of the Logger to log to.
	 * @param level The level of the log message.
	 * @param message The message itself.
	 * @param t An instance of Throwable, if an exception occured.
	 */
	void logLevel(std::string srcObjClassName, std::string message, log4cxx::LevelPtr pLevel);
	void logLevel(std::string srcObjClassName, std::string srcFunctionName, int lineNumber, std::string message, log4cxx::LevelPtr pLevel);

friend class UILogger;
};

